<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改书籍')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-library-edit" th:object="${librarybook}">
		    <input name="typeId" type="hidden"  th:field="*{bookId}" />
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" th:field="*{name}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍作者：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="author" id="author" th:field="*{author}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍出版社：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="publish" id="publish" th:field="*{publish}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍编号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="isbn" id="isbn" th:field="*{isbn}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">书籍简介：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="introduction" id="introduction" th:field="*{introduction}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍语言：</label>
				<div class="col-sm-8">
					<select class="form-control" name="language">
						<option value="中文" th:selected="${librarybook.language} eq '中文'">中文</option>
						<option value="外语" th:selected="${librarybook.language} eq '外语'">外语</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍出版日期：</label>
				<div class="input-group date col-sm-8">
					<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					<input type="text" class="form-control" id="laydate-publishDate" name="publishDate" th:value="${#dates.format(librarybook.publishDate, 'yyyy-MM-dd')}" placeholder="yyyy-MM-dd">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍价格：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="price" id="price" th:field="*{price}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">书籍数量：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="count" id="count" th:field="*{count}" required>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label is-required">书籍书籍</label>
				<div class="col-sm-8">
					<select class="form-control" name="typeId">
						<option value="">--请选择书籍类型--</option>
						<option   th:each="libraryType:${libraryTypes}" th:value="${libraryType.typeId}" th:text="${libraryType.tyname}" th:selected="${librarybook.typeId} eq ${libraryType.typeId}"></option>
					</select>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "admin/library/book";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-library-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
